import 'package:enjoy_plus/pages/home/components/home_list.dart';
import 'package:enjoy_plus/pages/home/components/home_nav.dart';
import 'package:enjoy_plus/utils/http.dart';
import 'package:enjoy_plus/utils/toast.dart';
import 'package:flutter/material.dart';

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  void initState() {
    super.initState();
    //getNotifyListData();
  }

  // List notifyList = [];

  // getNotifyListData() async {
  //   final res = await http.get('/announcement');
  //   ToastUtil.showSuccess('获取成功');
  //   setState(() {
  //  //   notifyList = res['data'];
  //   });
  // }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color.fromARGB(255, 229, 231, 241),
      appBar: AppBar(
        title: Text('享+社区'),
        centerTitle: true,
        backgroundColor: Colors.transparent,
      ),
      body: ListView(
        padding: EdgeInsets.all(10),
        children: [
          //导航
          HomeNav(),
          SizedBox(height: 10),
          //公告图
          ClipRRect(
            borderRadius: BorderRadius.circular(10),
            child: Image.asset('images/banner@2x.jpg'),
          ),
          SizedBox(height: 10),
          //公告列表
          HomeList(),
        ],
      ),
    );
  }
}
